package cn.wolfcode.luowowo.article.domain;

import cn.wolfcode.luowowo.common.domain.BaseDomain;
import lombok.Getter;
import lombok.Setter;
import org.apache.commons.lang3.StringUtils;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

@Getter@Setter
public class Attraction extends BaseDomain {
    //包含 内部景点
    private Long parentId;
    //目的地对象
    private Destination dest;
    //内部景点
    private List<Attraction> inAtt;
    //景点标题
    private String title;
    //简要标题
    private String subtitle;
    //目的地概况
    private String summary;
    //封面图片,3张
    private String coverUrl;

    private  List<String> coverUrlList;
    //景点联系电话
    private String phone;
    //景点网址(官网)
    private String website;
    //景点交通
    private String traffic;
    //景点门票
    private String ticket;
    //景点开放时间
    private String openTime;
    //景点小提示
    private String tips;
    //是否热门
    private Integer ishot;
    //有多少人去过
    private Integer gonum;
    //有多少人收藏
    private Integer favornum;

    private Date createTime;

    private Integer state;

    public List<String> getCoverUrlList(){
        List<String> list = null ;
        if(StringUtils.isNotBlank(coverUrl)){
            String[] strs = coverUrl.split(",");
            list = new ArrayList<>();
            for (int i = 0; i <strs.length ; i++) {
                list.add(strs[i]);
            }
        }
        return  list;
    }

}